<template>
{{#if page.psSysPFPlugin}}
    {{> @macro/plugins/view/view-use.hbs appPlugin=page.psSysPFPlugin}}
{{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
    <AppViewLayout :class="classNames">
    {{#page.ctrls}}
    {{#eq controlType 'SEARCHFORM'}}
        <template #viewContentTop>
            {{> @macro/widgets/form-detail/search-form.hbs ctrl=ctrl}}
        </template>
    {{/eq}}
    {{#eq controlType 'TREEVIEW'}}
        <template #default>
            {{> @macro/widgets/tree-detail/tree.hbs ctrl=ctrl props=":singleSelect='singleSelect'"}}
        </template>
    {{/eq}}
    {{/page.ctrls}}
        {{> @macro/view/view-msg.hbs}}  
    </AppViewLayout>
    {{else}}
    <div :class="classNames">
        {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
        {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
        {{/if}}
    </div>
    {{/if}}
{{/if}}
</template>
<script setup lang="ts">
// 基于template/src/views/\{{appModules}}/\{{pages@DEPICKUPTREEVIEW}}/\{{spinalCase page.codeName}}.vue.hbs生成
{{#if page.psViewLayoutPanel.useDefaultLayout}}
import { AppViewLayout } from "@components/layout/view-layout";
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
{{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
{{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{/if}}
{{/if}}
import { model } from "./{{spinalCase page.codeName}}-model";
import { 
    useNavParamsBind, 
    useEventBind, 
    handleCtrlAction, 
    handleCtrlInit, 
    handleCtrlDestroy, 
    getViewClassNames,
{{#unless page.psViewLayoutPanel.useDefaultLayout}}
    handleComponentAction,
    {{#if page.psViewLayoutPanel.psControls}}
    {{#each page.psViewLayoutPanel.psControls as | ctrl |}}
    {{#eq ctrl.controlType 'TOOLBAR'}}
    handleToolbarItemClick,
    {{/eq}}
    {{/each}}
    {{/if}}
{{/unless}}
} from '@/hooks/use-view';
import { PickupTreeViewActionType, PickupTreeViewController, IPickupTreeViewAbility, IPickupTreeViewControllerParams, IPickupTreeViewStore, IPickupTreeViewController, IParam, IContext, ILoadingHelper, IEvent } from "@/core";
{{> @macro/view/view-props.hbs
  	props="singleSelect?: boolean"
	propsDefault="singleSelect: false"
}}

{{> @macro/common/emit.hbs name="view" actionType="PickupTreeViewActionType" ability="IPickupTreeViewAbility"}}

//  样式名称
const classNames = computed(() => {
    return getViewClassNames(model, props);
});

const params: IPickupTreeViewControllerParams<PickupTreeViewActionType, IPickupTreeViewAbility> = {
    name: props.name,
    model,
    evt,
    isLoadDefault: props.isLoadDefault,
    openType: props.openType,
    pLoadingHelper: props.pLoadingHelper,
    handler: (data: IPickupTreeViewStore) => { return reactive(data); }
}

{{> @macro/common/controller.hbs name="view" IController="IPickupTreeViewController" store="IPickupTreeViewStore" ability="IPickupTreeViewAbility" controller="PickupTreeViewController"}}
</script>
